importScripts('core.js',
				'enc-base64.js',
				'md5.js',
				'evpkdf.js',
				'cipher-core.js',
				'rabbit.js');
self.addEventListener('message', function(e) {
  var data = e.data;
  if (data.enc){
	var result = cry.Rabbit.encrypt(data.data, data.key).toString();
	self.postMessage({data: result, enc:1});
  }
  if (data.dec){
	var result = cry.Rabbit.decrypt((data.data), data.key).toString(cry.enc.Latin1);
	self.postMessage({data: result, dec:1});
  }
}, false);